home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 6 / QRZ Ham Radio Callsign Database - Volume 6.iso / pc / files / finland / ddlcpack.lzh / DDLC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-06  |  23.2 KB  |  431 lines

  1. /*  */
  2. /****************************************************************
  3.  *                                                              *
  4.  *      typedefs of the complete DDLC register structure        *
  5.  *                                                              *
  6.  * (DDLC = MC145488 - Dual Data Link Controller)                *
  7.  * (These structures are from booklet  ADI1524 aka MC145488/D)  *
  8.  *                                                              *
  9.  *   A device driver for KA9Q  NOS (92)0521 or later version.   *
  10.  *   By Matti Aarnio  <mea@utu.fi>  OH1MQK                      *
  11.  *                                                              *
  12.  ****************************************************************/
  13.  
  14. #ifndef DDLCMAX
  15. #define DDLCMAX 2   /* 2 boards, 4 channels each */
  16. #define CHANNELS_ON_BOARD 4
  17. #define LOG_CHANNELS_ON_BOARD 2
  18. #define DDLCCMAX (DDLCMAX*CHANNELS_ON_BOARD)
  19. #include "global.h"
  20. #define AX_MTU 512
  21.  
  22.  
  23. #define OFF 0
  24. #define ON  1
  25.  
  26. #if    DDLCMAX == 2
  27. /* In  ddlcvec.asm: */
  28. INTERRUPT ddlc0vec __ARGS((void));
  29. INTERRUPT ddlc1vec __ARGS((void));
  30. #endif
  31.  
  32. /* In  ddlc.c: */
  33. /*INTERRUPT (far *(ddlcint) __ARGS((int dev)))();*/
  34.  
  35. /*#define INTEGER short int*/
  36. #define BIT_FIELD unsigned
  37.  
  38. /*
  39.  *  Individual register unions - both for little-endian, as well as
  40.  *  big endian..
  41.  */
  42. typedef union {                         /* System control register          */
  43.     int16   SysCntr;
  44.     struct  {
  45. #ifdef  _BIG_ENDIAN   /* 68000 et.al. */
  46.         BIT_FIELD               : 8;    /* 8-f: Dummy bits                  */
  47.         BIT_FIELD   TEST        : 3;    /* 5-7: Factory Test Modes          */
  48.         BIT_FIELD   DTACKEn     : 1;    /* 4: DTACK Enable                  */
  49.         BIT_FIELD   WAIT        : 2;    /* 2-3: Wait State Select           */
  50.         BIT_FIELD   RESET       : 1;    /* 1: Software Reset                */
  51.         BIT_FIELD   BW          : 1;    /* 0: Bus Width (status)            */
  52. #else /* Little-endian */
  53.         BIT_FIELD   BW          : 1;    /* 0: Bus Width (status)            */
  54.         BIT_FIELD   RESET       : 1;    /* 1: Software Reset                */
  55.         BIT_FIELD   WAIT        : 2;    /* 2-3: Wait State Select           */
  56.         BIT_FIELD   DTACKEn     : 1;    /* 4: DTACK Enable                  */
  57.         BIT_FIELD   TEST        : 3;    /* 5-7: Factory Test Modes          */
  58.         BIT_FIELD               : 8;    /* 8-f: Dummy bits                  */
  59. #endif
  60.     } sys_control;
  61. } SYSCONTROL;
  62.  
  63. typedef union  {                        /* master status register (vector)  */
  64.     int16   Vector;
  65.     struct  {
  66. #ifdef  _BIG_ENDIAN
  67.         BIT_FIELD               : 8;    /* 8-f: Dummy Bits                  */
  68.         BIT_FIELD   VecUser     : 4;    /* 4-7: User programmable bits      */
  69.         BIT_FIELD   VecNum      : 4;    /* 0-3: Vector number               */
  70. #else /* Little-endian */
  71.         BIT_FIELD   VecNum      : 4;    /* 0-3: Vector number               */
  72.         BIT_FIELD   VecUser     : 4;    /* 4-7: User programmable bits      */
  73.         BIT_FIELD               : 8;    /* 8-f: Dummy Bits                  */
  74. #endif
  75.     } mstr_stat;
  76. } MASTERSTATUS;
  77.  
  78. typedef union {                         /* Interrupt enable register        */
  79.     int16   IntEn;
  80.     struct  {
  81. #ifdef  _BIG_ENDIAN
  82.         BIT_FIELD   SCPC        : 1;    /* f: SCP Interrupt Enable          */
  83.         BIT_FIELD   CD1         : 1;    /* e: CD1 Interrupt Enable          */
  84.         BIT_FIELD   CD0         : 1;    /* d: CD0 Interrupt Enable          */
  85.         BIT_FIELD   Rx1Idl      : 1;    /* c: Ch 1 Idle Interrupt Enable    */
  86.         BIT_FIELD   Rx0Idl      : 1;    /* b: Ch 0 Idle Interrupt Enable    */
  87.         BIT_FIELD   RxBOvr      : 1;    /* a: Rx Buffer Overrun Int Enable  */
  88.         BIT_FIELD   TxFUnr      : 1;    /* 9: Tx FIFO Underrun Int Enable   */
  89.         BIT_FIELD   RxFOvr      : 1;    /* 8: Rx FIFO Overrun Int Enable    */
  90.         BIT_FIELD   Tx1FC       : 1;    /* 7: Ch 1 Tx Frame Complete Int Ena */
  91.         BIT_FIELD   Tx0FC       : 1;    /* 6: Ch 0 Tx Frame Complete Int Ena */
  92.         BIT_FIELD   Tx1DMAC     : 1;    /* 5: Ch 1 Tx DMA Complete Int Ena  */
  93.         BIT_FIELD   Tx0DMAC     : 1;    /* 4: Ch 0 Tx DMA Complete Int Ena  */
  94.         BIT_FIELD   Rx1DMAC     : 1;    /* 3: Ch 1 Rx DMA Complete Int Ena  */
  95.         BIT_FIELD   Rx0DMAC     : 1;    /* 2: Ch 0 Rx DMA Complete Int Ena  */
  96.         BIT_FIELD   AddrErr     : 1;    /* 1: Address Error Interrupt Ena   */
  97.         BIT_FIELD   BusErr      : 1;    /* 0: Bus Error Interrupt Enable    */
  98. #else /* Little-endian */
  99.         BIT_FIELD   BusErr      : 1;    /* 0: Bus Error Interrupt Enable    */
  100.         BIT_FIELD   AddrErr     : 1;    /* 1: Address Error Interrupt Ena   */
  101.         BIT_FIELD   Rx0DMAC     : 1;    /* 2: Ch 0 Rx DMA Complete Int Ena  */
  102.         BIT_FIELD   Rx1DMAC     : 1;    /* 3: Ch 1 Rx DMA Complete Int Ena  */
  103.         BIT_FIELD   Tx0DMAC     : 1;    /* 4: Ch 0 Tx DMA Complete Int Ena  */
  104.         BIT_FIELD   Tx1DMAC     : 1;    /* 5: Ch 1 Tx DMA Complete Int Ena  */
  105.         BIT_FIELD   Tx0FC       : 1;    /* 6: Ch 0 Tx Frame Complete Int Ena */
  106.         BIT_FIELD   Tx1FC       : 1;    /* 7: Ch 1 Tx Frame Complete Int Ena */
  107.         BIT_FIELD   RxFOvr      : 1;    /* 8: Rx FIFO Overrun Int Enable    */
  108.         BIT_FIELD   TxFUnr      : 1;    /* 9: Tx FIFO Underrun Int Enable   */
  109.         BIT_FIELD   RxBOvr      : 1;    /* a: Rx Buffer Overrun Int Enable  */
  110.         BIT_FIELD   Rx0Idl      : 1;    /* b: Ch 0 Idle Interrupt Enable    */
  111.         BIT_FIELD   Rx1Idl      : 1;    /* c: Ch 1 Idle Interrupt Enable    */
  112.         BIT_FIELD   CD0         : 1;    /* d: CD0 Interrupt Enable          */
  113.         BIT_FIELD   CD1         : 1;    /* e: CD1 Interrupt Enable          */
  114.         BIT_FIELD   SCPC        : 1;    /* f: SCP Interrupt Enable          */
  115. #endif
  116.     } int_enable;
  117. } IRQE;
  118.  
  119. typedef union {                         /* SCP status/control register      */
  120.     int16   SCPReg;
  121.     struct  {
  122. #ifdef  _BIG_ENDIAN
  123.         BIT_FIELD               : 1;    /* f: SCP Complete                  */
  124.         BIT_FIELD               : 1;    /* e: Slave/master select           */
  125.         BIT_FIELD   CI          : 1;    /* d: SCP Clock Invert              */
  126.         BIT_FIELD   BR          : 2;    /* b-c: SCP Baud Rate Select        */
  127.         BIT_FIELD   En1         : 1;    /* a: SCP Enable 1                  */
  128.         BIT_FIELD   En0         : 1;    /* 9: SCP Enable 0                  */
  129.         BIT_FIELD   TxEn        : 1;    /* 8: SCP Transmit Enable           */
  130.         BIT_FIELD   TxRx        : 8;    /* 0-7: SCP Tx/Rx Register          */
  131. #else /* Little-endian */
  132.         BIT_FIELD   TxEn        : 1;    /* 8: SCP Transmit Enable           */
  133.         BIT_FIELD   En0         : 1;    /* 9: SCP Enable 0                  */
  134.         BIT_FIELD   En1         : 1;    /* a: SCP Enable 1                  */
  135.         BIT_FIELD   BR          : 2;    /* b-c: SCP Baud Rate Select        */
  136.         BIT_FIELD   CI          : 1;    /* d: SCP Clock Invert              */
  137.         BIT_FIELD               : 1;    /* e: Slave/master select           */
  138.         BIT_FIELD               : 1;    /* f: SCP Complete                  */
  139. #endif
  140.         } scpreg;
  141. } SCP;
  142.  
  143. typedef union {                         /* Timer register                   */
  144.     int16   timer;
  145.     struct  {
  146. #ifdef  _BIG_ENDIAN
  147.         BIT_FIELD               : 5;    /* b-f: Dummy bits                  */
  148.         BIT_FIELD   TIRQ        : 1;    /* a: Timer Interrupt Status bit    */
  149.         BIT_FIELD   WDE         : 1;    /* 9: Watchdog Enable (chan 0 only) */
  150.         BIT_FIELD   TEN         : 1;    /* 8: Timer Enable                  */
  151.         BIT_FIELD   count       : 8;    /* 0-7: 8-bit Timer Register        */
  152. #else /* Little-endian */
  153.         BIT_FIELD   count       : 8;    /* 0-7: 8-bit Timer Register        */
  154.         BIT_FIELD   TEN         : 1;    /* 8: Timer Enable                  */
  155.         BIT_FIELD   WDE         : 1;    /* 9: Watchdog Enable (chan 0 only) */
  156.         BIT_FIELD   TIRQ        : 1;    /* a: Timer Interrupt Status bit    */
  157.         BIT_FIELD               : 5;    /* b-f: Dummy bits                  */
  158. #endif
  159.     } Timer;
  160. } TIMER;
  161.  
  162.  
  163. /*
  164.  *  Structure of the channel's status/control and buffer
  165.  *  descriptor registers
  166.  */
  167. typedef struct {                        /* Channel status/control registers */
  168.     union   {
  169.         int16   SerCont;
  170.         struct  {
  171. #ifdef  _BIG_ENDIAN
  172.             BIT_FIELD           : 1;    /* f: Dummy bit                     */
  173.             BIT_FIELD   SCPE    : 1;    /* e: SCP Enable                    */
  174.             BIT_FIELD   TOL     : 1;    /* d: Transmit on Loop              */
  175.             BIT_FIELD   LOOP    : 1;    /* c: Loopback                      */
  176.             BIT_FIELD   TRSP    : 1;    /* b: Transparent Operation         */
  177.             BIT_FIELD   MODE    : 3;    /* 8-a: Mode Bits                   */
  178.             BIT_FIELD   MASK    : 8;    /* 0-7: Bit Mask Register           */
  179. #else /* Little-endian */
  180.             BIT_FIELD   MASK    : 8;    /* 0-7: Bit Mask Register           */
  181.             BIT_FIELD   MODE    : 3;    /* 8-a: Mode Bits                   */
  182.             BIT_FIELD   TRSP    : 1;    /* b: Transparent Operation         */
  183.             BIT_FIELD   LOOP    : 1;    /* c: Loopback                      */
  184.             BIT_FIELD   TOL     : 1;    /* d: Transmit on Loop              */
  185.             BIT_FIELD   SCPE    : 1;    /* e: SCP Enable                    */
  186.             BIT_FIELD           : 1;    /* f: Dummy bit                     */
  187. #endif
  188.         } serial_control;
  189.     } SerControl;
  190.     union   {                           /* transmit control register        */
  191.         int16   TxCntr;
  192.         struct  {
  193. #ifdef  _BIG_ENDIAN
  194.             BIT_FIELD           : 9;    /* 7-f: Dummy bits                  */
  195.             BIT_FIELD   DI      : 1;    /* 6: Data Invert                   */
  196.             BIT_FIELD   FA      : 1;    /* 5: Force Abort                   */
  197.             BIT_FIELD   MD      : 1;    /* 4: Mask Drive                    */
  198.             BIT_FIELD   FCE     : 1;    /* 3: Force CRC Error               */
  199.             BIT_FIELD   ITF     : 1;    /* 2: Inter-frame Time Fill         */
  200.             BIT_FIELD   BR      : 1;    /* 1: Buffer Ready                  */
  201.             BIT_FIELD   TE      : 1;    /* 0: Transmit Enable               */
  202. #else /* Little-endian */
  203.             BIT_FIELD   TE      : 1;    /* 0: Transmit Enable               */
  204.             BIT_FIELD   BR      : 1;    /* 1: Buffer Ready                  */
  205.             BIT_FIELD   ITF     : 1;    /* 2: Inter-frame Time Fill         */
  206.             BIT_FIELD   FCE     : 1;    /* 3: Force CRC Error               */
  207.             BIT_FIELD   MD      : 1;    /* 4: Mask Drive                    */
  208.             BIT_FIELD   FA      : 1;    /* 5: Force Abort                   */
  209.             BIT_FIELD   DI      : 1;    /* 6: Data Invert                   */
  210.             BIT_FIELD           : 9;    /* 7-f: Dummy bits                  */
  211. #endif
  212.         } tx_control;
  213.     } TxCont;
  214.     union   {                           /* receive control register         */
  215.         int16   RxCntr;
  216.         struct  {
  217. #ifdef  _BIG_ENDIAN
  218.             BIT_FIELD           : 9;    /* 7-f: Dummy Bits                  */
  219.             BIT_FIELD   DI      : 1;    /* 6: Data Invert                   */
  220.             BIT_FIELD   ABS     : 1;    /* 5: Address Byte Select           */
  221.             BIT_FIELD   ACE     : 1;    /* 4: Address Compare Enable        */
  222.             BIT_FIELD   RCE     : 1;    /* 3: Receive on CRC Error          */
  223.             BIT_FIELD   BBR     : 1;    /* 2: Buffer B Ready                */
  224.             BIT_FIELD   BAR     : 1;    /* 1: Buffer A Ready                */
  225.             BIT_FIELD   RE      : 1;    /* 0: Receiver Enable               */
  226. #else /* Little-endian */
  227.             BIT_FIELD   RE      : 1;    /* 0: Receiver Enable               */
  228.             BIT_FIELD   BAR     : 1;    /* 1: Buffer A Ready                */
  229.             BIT_FIELD   BBR     : 1;    /* 2: Buffer B Ready                */
  230.             BIT_FIELD   RCE     : 1;    /* 3: Receive on CRC Error          */
  231.             BIT_FIELD   ACE     : 1;    /* 4: Address Compare Enable        */
  232.             BIT_FIELD   ABS     : 1;    /* 5: Address Byte Select           */
  233.             BIT_FIELD   DI      : 1;    /* 6: Data Invert                   */
  234.             BIT_FIELD           : 9;    /* 7-f: Dummy Bits                  */
  235. #endif
  236.         } rx_control;
  237.     } RxCont;
  238.     union   {                           /* transmit status register         */
  239.         int16   TxStatus;
  240.         struct  {
  241. #ifdef  _BIG_ENDIAN
  242.             BIT_FIELD           :10;    /* 6-f: Dummy Bits                  */
  243.             BIT_FIELD   FUN     : 1;    /* 5: FIFO Underrun                 */
  244.             BIT_FIELD   TFC     : 1;    /* 4: Transmit Frame Complete       */
  245.             BIT_FIELD   CTS     : 1;    /* 3: CTS status                    */
  246.             BIT_FIELD   BE      : 1;    /* 2: Bus Error                     */
  247.             BIT_FIELD   AE      : 1;    /* 1: Address Error                 */
  248.             BIT_FIELD   TDC     : 1;    /* 0: Transmit DMA Complete         */
  249. #else /* Little-endian */
  250.             BIT_FIELD   TDC     : 1;    /* 0: Transmit DMA Complete         */
  251.             BIT_FIELD   AE      : 1;    /* 1: Address Error                 */
  252.             BIT_FIELD   BE      : 1;    /* 2: Bus Error                     */
  253.             BIT_FIELD   CTS     : 1;    /* 3: CTS status                    */
  254.             BIT_FIELD   TFC     : 1;    /* 4: Transmit Frame Complete       */
  255.             BIT_FIELD   FUN     : 1;    /* 5: FIFO Underrun                 */
  256.             BIT_FIELD           :10;    /* 6-f: Dummy Bits                  */
  257. #endif
  258.         } tx_stat;
  259.     } TxStat;
  260.     union   {                           /* receive status register          */
  261.         int16   RxStatus;
  262.         struct  {
  263. #ifdef  _BIG_ENDIAN
  264.             BIT_FIELD   CD      : 1;    /* f: CD pin status                 */
  265.             BIT_FIELD   RI      : 1;    /* e: receiver Link Idle            */
  266.             BIT_FIELD   CE      : 1;    /* d: CRC Error                     */
  267.             BIT_FIELD   CDIRQ   : 1;    /* c: CD Interrupt Status           */
  268.             BIT_FIELD   FO      : 1;    /* b: FIFO Overrun                  */
  269.             BIT_FIELD   RC      : 3;    /* 8-a: Residue Count               */
  270.             BIT_FIELD           : 2;    /* 6-7: Dummy Bits                  */
  271.             BIT_FIELD   BE      : 1;    /* 5: Bus Error                     */
  272.             BIT_FIELD   AE      : 1;    /* 4: Address Error                 */
  273.             BIT_FIELD   BBO     : 1;    /* 3: Buffer B Overrun              */
  274.             BIT_FIELD   BAO     : 1;    /* 2: Buffer A Overrun              */
  275.             BIT_FIELD   RBC     : 1;    /* 1: Buffer B Complete             */
  276.             BIT_FIELD   RAC     : 1;    /* 0: Buffer A Complete             */
  277. #else /* Little-endian */
  278.             BIT_FIELD   RAC     : 1;    /* 0: Buffer A Complete             */
  279.             BIT_FIELD   RBC     : 1;    /* 1: Buffer B Complete             */
  280.             BIT_FIELD   BAO     : 1;    /* 2: Buffer A Overrun              */
  281.             BIT_FIELD   BBO     : 1;    /* 3: Buffer B Overrun              */
  282.             BIT_FIELD   AE      : 1;    /* 4: Address Error                 */
  283.             BIT_FIELD   BE      : 1;    /* 5: Bus Error                     */
  284.             BIT_FIELD           : 2;    /* 6-7: Dummy Bits                  */
  285.             BIT_FIELD   RC      : 3;    /* 8-a: Residue Count               */
  286.             BIT_FIELD   FO      : 1;    /* b: FIFO Overrun                  */
  287.             BIT_FIELD   CDIRQ   : 1;    /* c: CD Interrupt Status           */
  288.             BIT_FIELD   CE      : 1;    /* d: CRC Error                     */
  289.             BIT_FIELD   RI      : 1;    /* e: receiver Link Idle            */
  290.             BIT_FIELD   CD      : 1;    /* f: CD pin status                 */
  291. #endif
  292.         } rx_status;
  293.     } RxStat;
  294.     struct  {                           /* address compare register         */
  295. #ifdef  _BIG_ENDIAN
  296.         unsigned char   AddrComp1;      /* 8-f: Compare Address 1           */
  297.         unsigned char   AddrComp0;      /* 0-7: Compare Address 0           */
  298. #else /* Little-endian */
  299.         unsigned char   AddrComp0;      /* 0-7: Compare Address 0           */
  300.         unsigned char   AddrComp1;      /* 8-f: Compare Address 1           */
  301. #endif
  302.     } AddCmp;
  303.     union   {                           /* wildcard register                */
  304.         int16   Wild;
  305.         struct  {
  306. #ifdef  _BIG_ENDIAN
  307.             BIT_FIELD           : 8;    /* 8-f: Dummy Bits                  */
  308.             BIT_FIELD   WildCard: 8;    /* 0-7: Address Wildcard Bits       */
  309. #else /* Little-endian */
  310.             BIT_FIELD   WildCard: 8;    /* 0-7: Address Wildcard Bits       */
  311.             BIT_FIELD           : 8;    /* 8-f: Dummy Bits                  */
  312. #endif
  313.         } wildbits;
  314.     } WildBits;
  315.     union   {                           /* CRC error count                  */
  316.         int16   CRCErr;
  317.         struct  {
  318. #ifdef  _BIG_ENDIAN
  319.             BIT_FIELD           : 8;    /* 8-f: Dummy Bits                  */
  320.             BIT_FIELD   CRCError: 8;    /* 0-7: CRC Error Count             */
  321. #else /* Little-endian */
  322.             BIT_FIELD   CRCError: 8;    /* 0-7: CRC Error Count             */
  323.             BIT_FIELD           : 8;    /* 8-f: Dummy Bits                  */
  324. #endif
  325.         } crcerrors;
  326.     } CRCErrors;
  327.     int16   TxFrLen;                    /* Transmit Frame Length            */
  328.     int16   TxBase;                     /* Transmit Buffer Base Address     */
  329.     int16   TxByteCnt;                  /* Transmit Byte Count              */
  330.     int16   RxBufLen;                   /* Receive Buffer Length            */
  331.     int16   RxABase;                    /* Receive Buffer A Base Address    */
  332.     int16   RxAByteCnt;                 /* Receive Buffer A Byte Count      */
  333.     int16   RxBBase;                    /* Receive Buffer B Base Address    */
  334.     int16   RxBByteCnt;                 /* Receive Buffer B Byte Count      */
  335. } CH_REGS;
  336.  
  337. /*
  338.  * typedef of the complete DDLC register structure
  339.  */
  340. typedef struct {
  341.     SYSCONTROL      System;             /* System control register          */
  342.     MASTERSTATUS    MStat;              /* Master status register           */
  343.     IRQE            Interrupt;          /* Interrupt enable register        */
  344.     int16           Select16;           /* Dummy register for 16-bit bus    */
  345.     int16   unused_space0[4];           /* unused space */
  346.     SCP             scp;                /* SCP register                     */
  347.     TIMER           timeout[2];         /* Timer registers                  */
  348.     int16   unused_space1[5];           /* unused space */
  349.     CH_REGS         Ch_Regs[2];         /* Channel status/control registers */
  350.     int16   _dummy_space[16]; /* Not used */
  351. } DDLC;
  352.  
  353. #ifndef NO_NOS_PARTS
  354. /* Now real NOS device driver parts.. */
  355.  
  356. struct DDLCTAB {
  357.         INTERRUPT (*oldvec) __ARGS((void)); /* Original interrupt vector contents */
  358.     char far* boardbase;            /* DDLC card base address           */
  359.         int16   boardsize;              /* 2-port memory size: 16k/32k      */
  360.         unsigned vec;                   /* Interrupt vector of this board   */
  361.         long    ints;                   /* Interrupt count                  */
  362.         char    channelcnt;             /* 2 or 4 channels equiped          */
  363.     char far* nextfreebuf;        /* for allocating buffers for channels */
  364.     int    bufavail;        /* For monitoring the allocation of buffer */
  365.     int    attachlog;        /* |= 1 << (channel & 3)        */
  366.     int16    dtrreg;            /* Write-only register..        */
  367. };
  368.  
  369. extern struct DDLCTAB Ddlc[];
  370.  
  371.  
  372. struct ddlcchan {
  373.         long    rxints;             /* Receiver interrupts                  */
  374.     long    txints;             /* Transmitter interrupts               */
  375.         long    exints;             /* External/status interrupts           */
  376.  
  377.         long    enqueued;           /* Packets enqueued for transmit        */
  378.         long    rxframes;           /* Packets received                     */
  379.         int     crcerrs;            /* CRC Errors                           */
  380.         int     rovers;             /* Receiver overruns                    */
  381.         int     tunders;            /* Transmitter underruns                */
  382.  
  383. /*?*/   struct mbuf *rcvbuf;        /* Buffer for current rx packet         */
  384.         int16   bufsiz;             /* Size of rcv- and txbufs (rcpX, txpX) */
  385.         char   *rcp1, *rcp2;        /* Pointer into rcvbuf                  */
  386.     char    rxside;            /* ==0: Pick rcp1 first, else pick rcp2 */
  387.  
  388.         struct mbuf *sndq;          /* Packets awaiting transmission        */
  389.         int16   sndcnt;             /* Number of packet on sndq             */
  390.         struct mbuf *sndbuf;        /* Current buffer being transmitted     */
  391.     char   *txp1, *txp2;        /* Pointer into transmit buffer        */
  392.     int16    TxAbase;        /* Value to be loaded into DDLC channel */
  393.     int16    TxBbase;        /* TxBase -register for txp1/txp2..     */
  394.     char    txside;            /* 0: use TxAbase, !0: use TxBbase        */
  395.         char    tstate;             /* Transmitter state                    */
  396. #define IDLE    0            /* Transmitter off, no data pending     */
  397. #define ACTIVE    1            /* Transmitter on, sending data         */
  398. #define UNDERRUN 2            /* Transmitter on, flushing CRC         */
  399. #define FLAGOUT 3            /* CRC sent - attempt to start next frame*/
  400. #define DEFER   4             /* Receive Active - DEFER Transmit      */
  401. #define ST_TXDELAY 5            /* Sending leading flags                */
  402. #define CRCOUT  6
  403.     struct timer defer;        /* Delay timer                          */
  404.     char    rstate;             /* Set when !DCD goes to 0 (TRUE)       */
  405. /* Normal state is ACTIVE if Receive enabled */
  406. #define RXERROR 2            /* Error -- Aborting current Frame      */
  407. #define RXABORT 3            /* ABORT sequence detected              */
  408. #define TOOBIG 4            /* too large a frame to store           */
  409.     struct DDLCTAB *Board;      /* Pointer to board data                */
  410.     int16   dev;            /* Device number                        */
  411.         int16   unit;               /* channel nro on board: 0..3           */
  412. /* Shared memory handling ? */
  413.     char   *speed;            /* Line speed, bps (informational only) */
  414.     char    duplex;            /* 0 == half-duplex                */
  415.     int16   txdelay;        /* Transmit Delay 10 ms/cnt             */
  416.     char    persist;        /* Persistence (0-255) as a %           */
  417.     int16   slotime;        /* Delay to wait on persistence hit     */
  418.     int16   squeldelay;        /* Delay after XMTR OFF for squelch tail */
  419.     int16    waittime;        /* XX: ?? from scc.c */
  420.     int16    maxkeyup;        /* XX: ?? from scc.c */
  421.     int16    mintime;        /* XX: ?? from scc.c */
  422.     int16    idletime;        /* XX: ?? from scc.c */
  423.     int16    group;            /* XX: ?? from scc.c */
  424.     int16    enddelay;        /* XX: ?? from scc.c */
  425.     struct iface *iface;        /* Associated interface                 */
  426.     int32   deftime;        /* Time when xmit is enabled            */
  427. };
  428.  
  429. #endif /* ifndef NO_NOS_PARTS */
  430. #endif /* ifndef DDLCMAX */
  431.